<template>
    <div>
        <van-popup ref="popup" class="popup" v-model="show_value" :close-on-click-overlay="false" round>
            <div class="popup-content">
                <img class="popup-icon" src="https://files.onestep6.com/cloud/popup-icon.png" />
                <div class="popup-txt">{{ txt }}</div>
                <div class="content-btn">
                    <van-button class="btn-left" @click="close()">再想想</van-button>
                    <van-button v-if="phone == ''" class="btn-right" @click="right()">{{ right_txt }}</van-button>
                    <a v-if="phone != ''" id="callBtn" :href="`tel:+86${phone}`">
                        <van-button class="btn-right" @click="right()">{{ right_txt }}</van-button>
                    </a>
                </div>
            </div>
        </van-popup>
    </div>
</template>
<script>
    export default {
        props: {
            txt: {
				type: String,
				default: ''
			},
            phone: {
                type: String,
				default: ''
            },
            right_txt: {
                type: String,
				default: '确定'
            }
        },
        data() {
            return {
                show_value: false
            }
        },
        methods: {
            show() {
                this.show_value = true; 
            },
            close() {
                this.show_value = false; 
            },
            right() {
                this.$emit('right', '')
                this.show_value = false; 
            }
        }
    }
</script>
<style lang="less" scoped>
.popup-content{
    width: 574px;
    padding: 48px 46px;
    background: #FFFFFF;
    border-radius: 32px;
    .popup-icon{
        display: block;
        width: 96px;
        height: 96px;
        margin: 0 auto 32px;
    }
    .popup-txt{
        font-size: 28px;
        line-height: 44px;
        color: #202630;
        font-weight: 400;
        text-align: center;
        font-weight: bold;
    }
    .content-btn{
        display: flex;
        justify-content: space-between;
        padding-top: 54px;
        .btn-left{
            width: 226px;
            height: 76px;
            background: #F5F5F6;
            border-radius: 12px;
            font-size: 32px;
            line-height: 76px;
            text-align: center;
            font-weight: bold;
            color: #202630;
            border-radius: 64px;
            border: none;
        }
        .btn-right{
            width: 226px;
            height: 76px;
            background: #49CA6F;
            border-radius: 12px;
            font-size: 32px;
            line-height: 76px;
            text-align: center;
            font-weight: bold;
            color: #FFFFFF;
            border-radius: 64px;
            border: none;
        }
    }
}
</style>